/*
 * @Author: huzhanglin 799490931@qq.com
 * @Date: 2023-12-24 09:57:45
 * @LastEditors: huzhanglin 799490931@qq.com
 * @LastEditTime: 2023-12-24 12:58:39
 * @FilePath: \my-app01\src\app\user\user.component.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Component, Inject } from '@angular/core';
import { LocalStorageService } from '../services/local-storage.service';
import { LogService } from '../services/log-service.service';

@Component({
  selector: 'app-user',
  standalone: true,
  imports: [],
  templateUrl: './user.component.html',
  styleUrl: './user.component.css',
})
export class UserComponent {
  count = 0;
  imgUrl = '1.jpg';
  store: any = null;
  constructor(store: LocalStorageService) {
    this.store = store;
  }

  sub() {
    this.store.remove('NAME' + this.count);
    this.count = this.count - 1;
  }
  add() {
    this.count = this.count + 1;
    this.store.set('NAME' + this.count, 'ZHANGSAN1');
    // https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/105825998
    // localStorage.getItem('1')
    // localStorage.setItem('NAME', 'ZHANGSAN');
  }
}
